package org.come.Jpanel;

import com.tool.btn.AircraftBtn;
import com.tool.btn.FormsOnOffBtn;
import com.tool.image.ImageMixDeal;
import com.tool.role.RoleData;
import com.tool.tcp.NewPart;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;

import org.come.entity.Fly;
import org.come.entity.Goodstable;
import org.come.until.*;

import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.math.BigDecimal;

//

/**
 * 飞行器
 *
 * @author Administrator
 */
public class AircraftJPanel extends JPanel {

    private JLabel labShowName;//大标题
    private int numExp;
    private JLabel labStage;//几阶
    private JLabel labBurn;//燃灵值
    private ImageIcon iconExp;
    private ImageIcon icon;
    private NewPart part;
    private JLabel labOneGoods;
    private JLabel labTwoGoods;
    private JLabel labName;//飞行器名字
    private JLabel labflyimg,// 放置飞行器图像
            labflylevel,// 飞行器等级
            labflytili,// 飞行器体力
            labflyexp;// 飞行器经验
    private RichLabel richPaneDetails;
    private Integer flyId;
    private JList<String> listfly;// 飞行器名字列表
    private DefaultListModel<String> modelfly;// 飞行器名字列表对象
    private JScrollPane paneList;//名字滚动条
    private JScrollPane paneDetails;//技能滚动条
    private AircraftBtn btnFight;//飞行按钮
    private AircraftBtn btnRedo;
    private AircraftBtn btnInquire;
    private AircraftBtn btnUpgrade;
    private AircraftBtn btnAdvance;
    private AircraftBtn btnEffects;
    private AircraftBtn btnAdd;
    private String skin;

    public AircraftJPanel() {

        // 关闭按钮事件
        if ("水墨UI".equals(MyIsif.getStyle())) {
            this.setPreferredSize(new Dimension(513, 424));
            this.setOpaque(false);
            this.setLayout(null);
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 119);
            offBtn.setBounds(513 - 37, 10, 25, 25);
            this.add(offBtn);
        } else {
            this.setPreferredSize(new Dimension(463, 448));
            this.setOpaque(false);
            this.setLayout(null);
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/1/s74.png", 1, 119);
            offBtn.setBounds(463 - 49, 0, 23, 23);
            this.add(offBtn);
        }

        labflyimg = new JLabel();
        labflyimg.setBounds(100, 60, 200, 200);
        this.add(labflyimg);

        Font font = new Font("微软雅黑", 1, 12);
//        this.getPaneDetails();
        this.getLabBurn();
        this.getLabExp();
        this.getLabLvl();
        this.getLabName();
        this.getLabShowName();
        this.getLabStage();
        this.getBtnAdd();
        this.getBtnAdvance();
        this.getBtnFight();
        this.getBtnInquire();
        this.getBtnRedo();
        this.getBtnUpgrade();
        this.getLabOneGoods();
        this.getLabTwoGoods();
        modelfly = new DefaultListModel<String>();
        listfly = new JList<String>() {
            {
                setOpaque(false);
            } // instance initializer
        };
        listfly.setSelectionBackground(new Color(33, 42, 52));
        listfly.setSelectionForeground(Color.GREEN);
        listfly.setForeground(Color.GREEN);
        listfly.setFont(new Font("微软雅黑", 1, 14));
        listfly.setBackground(UIUtils.Color_BACK); // 设置列表框为透明背景
        listfly.setModel(modelfly);
        listfly.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                try {
                    if (listfly.getSelectedIndex() >= 0) {

                        Fly fly = ZhuJpanel.getListFly().get(listfly.getSelectedIndex());
                        ExpIncreaseUntil.ShouFlyValue(fly);
                        if (fly.getFlytid() == ImageMixDeal.userimg.getRoleShow().getFly_id()) {
                            btnFight.setText("待机");
                        } else {
                            btnFight.setText("飞行");
                        }
                    }

                } catch (Exception e2) {
                    e2.printStackTrace();
                }

            }
        });
        this.paneList = new JScrollPane(this.listfly);
        this.paneList.setVerticalScrollBarPolicy(22);
        this.paneList.getVerticalScrollBar().setUI(new SrcollPanelUI());
        this.paneList.getVerticalScrollBar().setUnitIncrement(20);
        this.paneList.getViewport().setOpaque(false);
        this.paneList.setOpaque(false);
        if ("水墨UI".equals(MyIsif.getStyle())) {
            this.paneList.setBounds(48, 320, 177, 90);
        } else {
            this.paneList.setBounds(20, 340, 228, 87);
        }
        this.paneList.setBorder(BorderFactory.createEmptyBorder());
        this.paneList.setHorizontalScrollBarPolicy(31);
        this.add(this.paneList);
    }


    public void changskin(RoleData roleData, String skin) {

        this.part = SpriteFactory.createPart(RoleData.getRoleData().getLoginResult().getSpecies_id().longValue(), 2, 1, null);
        this.part.setFly(skin, 2,true);
        this.part.setFlyShadow(skin + "1", 2);
    }

    public void drawGoodsNum(Graphics g) {
        Goodstable[] goodslist = GoodsListFromServerUntil.getGoodslist();
        int length = goodslist.length;
        g.setFont(UIUtils.TEXT_FONT);
        g.setColor(Color.red);

        for (int i = 0; i < length; ++i) {
            if (goodslist[i] != null && goodslist[i].getType() == 1102L) {
                g.drawString(String.valueOf(goodslist[i].getUsetime()), 341, 180);
            }

            if (goodslist[i] != null && goodslist[i].getType() == 1101L) {
                g.drawString(String.valueOf(goodslist[i].getUsetime()), 408, 180);
            }
        }

    }

    private NewPart newPart;
    private BigDecimal se;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.icon == null) {
                this.icon = CutButtonImage.getImage("inkImg/newbackground/B227.png", -1, -1);
            }

            g.drawImage(this.icon.getImage(), 0, 0, null);
            if (this.iconExp == null) {
                this.iconExp = CutButtonImage.getImage("skin/8100226/button/66.png", 108, 15);
            }
        } else {
            if (this.icon == null) {
                this.icon = new ImageIcon("inkImg/number/npk/a/H206.png");
            }

            g.drawImage(this.icon.getImage(), 0, 0, null);
            if (this.iconExp == null) {
                this.iconExp = CutButtonImage.getImage("skin/8100226/button/66.png", 108, 15);
            }
        }


        g.drawImage(this.iconExp.getImage(), 321, 108, this.numExp, 15, null);
        if (this.part != null) {
            this.part.draw(g, 159, 182, 0, ImageMixDeal.userimg.getTime());
        }
        if (listfly.getSelectedIndex() != -1) {
            int index = listfly.getSelectedIndex();
            if (ZhuJpanel.getListFly().size() > index) {
                Fly fly = ZhuJpanel.getListFly().get(index);
                if (newPart == null) {
                    flyId = fly.getFlytid();
                    se = ImageMixDeal.userimg.getRoleShow().getSpecies_id();
                    newPart = SpriteFactory.createPart(RoleData.getRoleData().getLoginResult().getSpecies_id().longValue(), 2, 1, null);
                    newPart.setFly(this.skin, 2,true);
                    newPart.setFlyShadow(this.skin + "1", 2);
                    this.getLabName().setText(fly.getFlyname() + "(" + getJieshu(fly.getFlystate()) + "阶)");

                } else {
                    if (!flyId.equals(fly.getFlytid())) {//||se.compareTo(ImageMixDeal.userimg.getRoleShow().getSpecies_id())!=0
                        flyId = fly.getFlytid();
                        se = ImageMixDeal.userimg.getRoleShow().getSpecies_id();
                        newPart = SpriteFactory.createPart(RoleData.getRoleData().getLoginResult().getSpecies_id().longValue(), 2, 1, null);
                        newPart.setFly(this.skin, 2,true);
                        newPart.setFlyShadow(this.skin + "1", 2);
                        this.getLabName().setText(fly.getFlyname() + "(" + getJieshu(fly.getFlystate()) + "阶)");
                    }
                }
                if ("水墨UI".equals(MyIsif.getStyle())) {

                    newPart.draw(g, 185, 165, 0, ImageMixDeal.userimg.getTime());
                } else {

                    newPart.draw(g, 130, 170, 0, ImageMixDeal.userimg.getTime());
                }

            }
        }
    }

    @Override
    protected void paintChildren(Graphics g) {
        super.paintChildren(g);
        this.drawGoodsNum(g);
    }


    public void setPaneList(JScrollPane paneList) {
        this.paneList = paneList;
    }

    public JScrollPane getPaneDetails() {
        if (this.paneDetails == null) {
            this.paneDetails = new JScrollPane(this.getRichPaneDetails());
            this.paneDetails.setVerticalScrollBarPolicy(22);
            this.paneDetails.getVerticalScrollBar().setUI(new SrcollPanelUI());
            this.paneDetails.getVerticalScrollBar().setUnitIncrement(20);
            this.paneDetails.getViewport().setOpaque(false);
            this.paneDetails.setOpaque(false);
            this.paneDetails.setBounds(239, 327, 206, 63);
            this.paneDetails.setBorder(BorderFactory.createEmptyBorder());
            this.paneDetails.setHorizontalScrollBarPolicy(31);
            this.add(this.paneDetails);
        }

        return this.paneDetails;
    }

    public void setPaneDetails(JScrollPane paneDetails) {
        this.paneDetails = paneDetails;
    }

    public JLabel getLabName() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labName == null) {
                this.labName = new JLabel();
                this.labName.setBounds(324, 63, 148, 16);
                this.labName.setForeground(Color.white);
                this.labName.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labName);
            }

        } else {
            if (this.labName == null) {
                this.labName = new JLabel();
                this.labName.setBounds(299, 58, 103, 16);
                this.labName.setForeground(UIUtils.COLOR_BTNPUTONG2[0]);
                this.labName.setFont(UIUtils.TEXT_FONTZS);
                this.add(this.labName);
            }
        }

        return this.labName;
    }

    public void setLabName(JLabel labName) {
        this.labName = labName;
    }

    public JLabel getLabLvl() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labflylevel == null) {
                this.labflylevel = new JLabel();
                this.labflylevel.setBounds(372, 63 + 28, 70, 16);
                this.labflylevel.setForeground(Color.white);
                this.labflylevel.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflylevel);
            }
        } else {

            if (this.labflylevel == null) {
                this.labflylevel = new JLabel();
                this.labflylevel.setBounds(299, 88, 103, 16);
                this.labflylevel.setForeground(Color.white);
                this.labflylevel.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflylevel);
            }
        }

        return this.labflylevel;
    }

    public void setLabLvl(JLabel labLvl) {
        this.labflylevel = labLvl;
    }


    public JLabel getLabStage() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labStage == null) {

                this.labStage = new JLabel();
                this.labStage.setBounds(372, 63 + 28 * 2, 70, 16);
                this.labStage.setForeground(Color.white);
                this.labStage.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labStage);
            }
        } else {

            if (this.labStage == null) {

                this.labStage = new JLabel();
                this.labStage.setBounds(299, 115, 103, 16);
                this.labStage.setForeground(Color.white);
                this.labStage.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labStage);
            }
        }

        return this.labStage;
    }

    public void setLabStage(JLabel labStage) {
        this.labStage = labStage;
    }

    public JLabel getLabExp() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labflyexp == null) {
                this.labflyexp = new JLabel("0");
                this.labflyexp.setBounds(372, 63 + 28 * 3, 100, 16);
                this.labflyexp.setForeground(Color.white);
                this.labflyexp.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflyexp);
            }
        } else {

            if (this.labflyexp == null) {
                this.labflyexp = new JLabel("0");
                this.labflyexp.setBounds(299, 145, 103, 16);
                this.labflyexp.setForeground(Color.white);
                this.labflyexp.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflyexp);
            }
        }

        return this.labflyexp;
    }

    public void setLabExp(JLabel labExp) {
        this.labflyexp = labExp;
    }

    public JLabel getLabflytili() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labflytili == null) {
                this.labflytili = new JLabel();
                this.labflytili.setBounds(380, 63 + 88 + 28 * 3, 75, 16);
                this.labflytili.setForeground(Color.white);
                this.labflytili.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflytili);
            }

        } else {

            if (this.labflytili == null) {
                this.labflytili = new JLabel();
                this.labflytili.setBounds(121, 269, 121, 16);
                this.labflytili.setForeground(Color.white);
                this.labflytili.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labflytili);
            }

        }
        return this.labflytili;
    }

    public void setLabflytili(JLabel labflytili) {
        this.labflytili = labflytili;
    }

    public JLabel getLabBurn() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labBurn == null) {
                this.labBurn = new JLabel();
                this.labBurn.setBounds(380, 327, 75, 16);
                this.labBurn.setForeground(Color.white);
                this.labBurn.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labBurn);
            }
        } else {

            if (this.labBurn == null) {
                this.labBurn = new JLabel();
                this.labBurn.setBounds(121, 269, 121, 16);
                this.labBurn.setForeground(Color.white);
                this.labBurn.setFont(UIUtils.TEXT_FONT1);
                this.add(this.labBurn);
            }
        }

        return this.labBurn;
    }

    public void setLabBurn(JLabel labBurn) {
        this.labBurn = labBurn;
    }

    public JLabel getLabShowName() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labShowName == null) {
                this.labShowName = new JLabel("飞行器", 0);
                this.labShowName.setBounds(100, 298, 60, 20);
                this.labShowName.setForeground(Color.white);
                this.labShowName.setFont(UIUtils.TEXT_FONT60);
                this.add(this.labShowName);
            }
        }

        return this.labShowName;
    }

    public void setLabShowName(JLabel labShowName) {
        this.labShowName = labShowName;
    }

    public AircraftBtn getBtnUpgrade() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.btnUpgrade == null) {
                this.btnUpgrade = new AircraftBtn("skin/8100226/newbutton/B30.png", 1, "升级", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNTEXT, 0, this);
                this.btnUpgrade.setBounds(438, 63 + 28, 34, 17);
                this.add(this.btnUpgrade);
            }

        } else {
            if (this.btnUpgrade == null) {
                this.btnUpgrade = new AircraftBtn("inkImg/hongmu/1/B30h.png", 1, "升级", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNPUTONG2, 0, this);
                this.btnUpgrade.setBounds(370, 87, 34, 17);
                this.add(this.btnUpgrade);
            }
        }

        return this.btnUpgrade;
    }

    public void setBtnUpgrade(AircraftBtn btnUpgrade) {
        this.btnUpgrade = btnUpgrade;
    }

    public AircraftBtn getBtnAdvance() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.btnAdvance == null) {
                this.btnAdvance = new AircraftBtn("skin/8100226/newbutton/B30.png", 1, "进阶", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNTEXT, 1, this);
                this.btnAdvance.setBounds(438, 63 + 28 * 2, 34, 17);
                this.add(this.btnAdvance);
            }
        } else {
            if (this.btnAdvance == null) {
                this.btnAdvance = new AircraftBtn("inkImg/hongmu/1/B30h.png", 1, "进阶", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNPUTONG2, 1, this);
                this.btnAdvance.setBounds(370, 115, 34, 17);
                this.add(this.btnAdvance);
            }
        }

        return this.btnAdvance;
    }

    public void setBtnAdvance(AircraftBtn btnAdvance) {
        this.btnAdvance = btnAdvance;
    }

//    public AircraftBtn getBtnAdvance1() {
//        if(MyIsif.getStyle().equals("水墨UI")) {
//
//            if (this.btnEffects == null) {
//                this.btnEffects = new AircraftBtn(imageMap.getImgMap().get("B30"),"B30", 1, "特效", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNTEXT, 14, this);
//                this.btnEffects.setBounds(438, 63+28*1, 34, 17);
//                this.add(this.btnEffects);
//            }
//        }else{
//            if (this.btnEffects == null) {
//                this.btnEffects = new AircraftBtn("inkImg/hongmu/1/B30h.png", 1, "特效", UIUtils.TEXT_FONT, UIUtils.COLOR_BTNPUTONG2, 14, this);
//                this.btnEffects.setBounds(280, 115, 34, 17);
//                this.add(this.btnEffects);
//            }
//        }
//
//        return this.btnEffects;
//    }
//
//    public void setBtnAdvance1(AircraftBtn btnEffects) {
//        this.btnEffects = btnEffects;
//    }

    public AircraftBtn getBtnAdd() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.btnAdd == null) {
                this.btnAdd = new AircraftBtn("skin/8100226/button/16.png", 1, 2, this);
                this.btnAdd.setBounds(455, 235, 18, 18);
                this.add(this.btnAdd);
            }

        } else {
            if (this.btnAdd == null) {
                this.btnAdd = new AircraftBtn("inkImg/hongmu/2/55_png.button.btn_12.png", 1, 2, this);
                this.btnAdd.setBounds(206, 269, 18, 18);
                this.add(this.btnAdd);
            }
        }

        return this.btnAdd;
    }

    public void setBtnAdd(AircraftBtn btnAdd) {
        this.btnAdd = btnAdd;
    }

    public AircraftBtn getBtnFight() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.btnFight == null) {
                this.btnFight = new AircraftBtn("skin/8100226/newbutton/B20.png", 1, "飞行", UIUtils.TEXT_HY16, UIUtils.COLOR_WHITE2, 3, this);
                this.btnFight.setBounds(268, 380, 59, 24);
                this.add(this.btnFight);
            }

        } else {
            if (this.btnFight == null) {
                this.btnFight = new AircraftBtn("inkImg/hongmu/1/50x50.png", 1, "飞行", UIUtils.TEXT_HY16, UIUtils.COLOR_BTNPUTONG2, 3, this);
                this.btnFight.setBounds(270, 380, 60, 26);
                this.add(this.btnFight);
            }
        }

        return this.btnFight;
    }

    public void setBtnFight(AircraftBtn btnFight) {
        this.btnFight = btnFight;
    }

    public AircraftBtn getBtnRedo() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.btnRedo == null) {
                this.btnRedo = new AircraftBtn("skin/8100226/newbutton/B20.png", 1, "重洗", UIUtils.TEXT_HY16, UIUtils.COLOR_WHITE2, 4, this);
                this.btnRedo.setBounds(320, 380, 59, 24);
//    			this.add(this.btnRedo);
            }

        } else {
            if (this.btnRedo == null) {
                this.btnRedo = new AircraftBtn("inkImg/hongmu/1/50x50.png", 1, "重洗", UIUtils.TEXT_HY16, UIUtils.COLOR_BTNPUTONG2, 4, this);
                this.btnRedo.setBounds(320, 397, 60, 26);
//    			this.add(this.btnRedo);
            }
        }
        return this.btnRedo;
    }

    public void setBtnRedo(AircraftBtn btnRedo) {
        this.btnRedo = btnRedo;
    }

    public AircraftBtn getBtnInquire() {
        if ("水墨UI".equals(MyIsif.getStyle())) {
            if (this.btnInquire == null) {
                this.btnInquire = new AircraftBtn("skin/8100226/newbutton/B20.png", 1, "丢弃", UIUtils.TEXT_HY16, UIUtils.COLOR_WHITE2, 5, this);
                this.btnInquire.setBounds(382, 380, 59, 24);
                this.add(this.btnInquire);
            }
        } else {
            if (this.btnInquire == null) {
                this.btnInquire = new AircraftBtn("inkImg/hongmu/1/50x50.png", 1, "丢弃", UIUtils.TEXT_HY16, UIUtils.COLOR_BTNPUTONG2, 5, this);
                this.btnInquire.setBounds(360, 380, 60, 26);
                this.add(this.btnInquire);
            }
        }
        return this.btnInquire;
    }

    public void setBtnInquire(AircraftBtn btnInquire) {
        this.btnInquire = btnInquire;
    }

    public ImageIcon getIcon() {
        return this.icon;
    }

    public void setIcon(ImageIcon icon) {
        this.icon = icon;
    }

    /*public RichLabel getRichPanel() {
        if (this.richPanel == null) {
            this.richPanel = new RichLabel("", UIUtils.TEXT_FONT1);
        }

        return this.richPanel;
    }

    public void setRichPanel(RichLabel richPanel) {
        this.richPanel = richPanel;
    }

    public RichLabel getRichPaneDetails() {
        if (this.richPaneDetails == null) {
            this.richPaneDetails = new RichLabel("", UIUtils.TEXT_FONT);
        }

        return this.richPaneDetails;
    }

    public void setRichPaneDetails(RichLabel richPaneDetails) {
        this.richPaneDetails = richPaneDetails;
    }*/
    public RichLabel getRichPaneDetails() {
        if (this.richPaneDetails == null) {
            this.richPaneDetails = new RichLabel("", UIUtils.TEXT_FONT);
        }

        return this.richPaneDetails;
    }

    public void setRichPaneDetails(RichLabel richPaneDetails) {
        this.richPaneDetails = richPaneDetails;
    }

    public Integer getFlyId() {
        return this.flyId;
    }

    public void setFlyId(Integer flyId) {
        this.flyId = flyId;
    }

    public NewPart getPart() {
        return this.part;
    }

    public void setPart(NewPart part) {
        this.part = part;
    }

    public JLabel getLabOneGoods() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labOneGoods == null) {
                this.labOneGoods = new JLabel();
                this.labOneGoods.setBounds(337, 172, 55, 53);
                this.labOneGoods.setIcon(GoodsListFromServerUntil.imgpathAdaptive("99102", 53, 53));
                this.add(this.labOneGoods);
            }
        } else {

            if (this.labOneGoods == null) {
                this.labOneGoods = new JLabel();
                this.labOneGoods.setBounds(270, 172, 55, 53);
                this.labOneGoods.setIcon(GoodsListFromServerUntil.imgpathAdaptive("99102", 53, 53));
                this.add(this.labOneGoods);
            }
        }

        return this.labOneGoods;
    }

    public void setLabOneGoods(JLabel labOneGoods) {
        this.labOneGoods = labOneGoods;
    }

    public JLabel getLabTwoGoods() {
        if ("水墨UI".equals(MyIsif.getStyle())) {

            if (this.labTwoGoods == null) {
                this.labTwoGoods = new JLabel();
                this.labTwoGoods.setBounds(402, 172, 55, 53);
                this.labTwoGoods.setIcon(GoodsListFromServerUntil.imgpathAdaptive("99101", 53, 53));
                this.add(this.labTwoGoods);
            }

        } else {

            if (this.labTwoGoods == null) {
                this.labTwoGoods = new JLabel();
                this.labTwoGoods.setBounds(355, 172, 55, 53);
                this.labTwoGoods.setIcon(GoodsListFromServerUntil.imgpathAdaptive("99101", 53, 53));
                this.add(this.labTwoGoods);
            }

        }
        return this.labTwoGoods;
    }

    public void setLabTwoGoods(JLabel labTwoGoods) {
        this.labTwoGoods = labTwoGoods;
    }

    public DefaultListModel<String> getmodelfly() {
        return modelfly;
    }

    ;

    public void setmodelfly(DefaultListModel<String> modelfly) {
        this.modelfly = modelfly;
    }

    ;

    public JList<String> getlistfly() {
        return listfly;
    }

    public void setListfly(JList<String> listfly) {
        this.listfly = listfly;
    }

    public String getSkin() {
        return skin;
    }

    public void setSkin(String skin) {
        this.skin = skin;
    }

    public static String getJieshu(int mun) {
        String l = "一";
        if (mun == 2) {
            l = "二";
        }
        if (mun == 3) {
            l = "三";
        }
        if (mun == 4) {
            l = "四";
        }
        if (mun == 5) {
            l = "五";
        }
        return l;
    }
}
